//项目路由
import {lazy,Suspense} from "react"
import {Route,Redirect,Switch} from "react-router-dom"
import Loading from "@/components/Loading"
//
const Login = lazy(()=>import('@/views/login/Index'))

const Home = lazy(()=>import('@/views/main/Home'))


const Routes =()=>{
    return (
    <Suspense fallback={<Loading/>}>
        <Switch>
            <Route path="/login" component={Login}></Route>
            <Route path="/home" component={Home}></Route>
            <Redirect from="/" to="/login"></Redirect>
        </Switch>
    </Suspense>)
}
export default Routes